package edu.pitt.myptm.datamanager;

public class PageInfo {
	int dirtybit;
	int fixcount;
	String blockId;
	int pageNo;//This is the number of the physical page
	
	public void fix() {
		this.fixcount = this.fixcount + 1;
	}
	
	public void unfix() {
		this.fixcount = this.fixcount - 1;
	}
	
	
	public int getDirtybit() {
		return dirtybit;
	}

	

	public void setDirtybit(int dirtybit) {
		this.dirtybit = dirtybit;
	}

	public void setDirty() {
		this.dirtybit = 1;
	}
	
	public void setClean() {
		this.dirtybit = 0;
	}

	public void setUnFixed() {
		this.fixcount = 0;
	}
	public int getFixcount() {
		return fixcount;
	}



	public void setFixcount(int fixcount) {
		this.fixcount = fixcount;
	}



	public String getBlockId() {
		return blockId;
	}



	public void setBlockId(String blockId) {
		this.blockId = blockId;
	}



	public int getPageNo() {
		return pageNo;
	}



	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}


	public PageInfo() {
		this.dirtybit = 0;
		this.fixcount = 0;
		this.blockId = null;
		this.pageNo = -1;
	}
	
	public PageInfo(String blockId,int pageNo, int dirtybit,int fixcount) {
		this.dirtybit = dirtybit;
		this.fixcount = fixcount;
		this.blockId = blockId;
		this.pageNo = pageNo;
	}
}
